package com.azusa.ktc_user.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.azusa.ktc_user.entity.User;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @Description 用户 数据访问接口
 * @date 2020-10-12 18:33:45
*/
public interface UserDao extends JpaRepository<User,String>,JpaSpecificationExecutor<User>{

    User findByMobile(String mobile);

    @Query("update User set fanscount=fanscount+?2 where id=?1")
    @Modifying
    void updateFons(String userId,Integer count);

    @Query("update User set followcount=followcount+?2 where id=?1")
    @Modifying
    void updateFollowCount(String userId,Integer count);
}

